package com.zjmzxfzhl.modules.purchase.controller.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author timyag
 * @Date 2020/7/14 10:03
 * @Version 1.0
 */

@Getter
@Setter
public class PurchasePaymentVo {


    private String contractCode;

    /**
     * 合同名称
     */
    private String contractName;

    /**
     * 合同状态
     */
    private String contractState;


    /**
     * 到货情况
     */
    private String aogSituation;


    private String paymentWay;

    private String invoice;


    ////

    /**
     * 所属合同id
     */
    @NotNull

    private Long contractId;

    /**
     * 付款单编号
     */
    @NotNull
    private String paymentCode;

    /**
     * 比例
     */
    @NotNull
    private Integer proportion;

    /**
     * 付款日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date paymentDate;

    /**
     * 付款审批状态
     */
    private String paymentApprovalState;

    /**
     * 付款情况
     */
    private String paymentSituation;

    /**
     * 备注
     */
    private String paymentComment;


    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return proportion + "% " + (paymentDate == null ? "" : sdf.format(paymentDate)) + " " + paymentApprovalState + " " + paymentSituation + " " + paymentComment;
    }

}
